<template>
  <div class="agreementDetail">
    <div v-html="detail"></div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { lastVersion } from '@/api/login';

const route = useRoute();
const router = useRouter();

const detail = ref('')

const getDetail = async() => {
  try {
    const res = await lastVersion()
    if (res.code === 200 && res.data) {
      const obj = res.data.find(el => el.dtype === route.query.cate) || ''
      detail.value = obj.content
    }
  } catch (error) {
    console.log(error);
  }
}

onMounted(() => {
    getDetail()
})
</script>

<style lang="scss" scoped>
.agreementDetail {
  padding: 20px;
}
</style>
